package junit;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.project.bean.MovieBase;
import com.project.business.component.DBComponent;

@RunWith(value = SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:applicationContext.xml")
public class C3p0Test {
	@Autowired
	private DBComponent dbComponent;

	@Test
	public void testaa() {
		try {
		//	System.out.println(dbComponent.getUserInfor());
			List<MovieBase> bases=dbComponent.getUserInfor();
			
			for (int i = 0; i < bases.size(); i++) {
				System.out.println(bases.get(i).getId());
			}
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println(e.getMessage());
		}
	}
}
